package alpaca.view;

import javax.swing.ImageIcon;

import alpaca.core.IServerModel;
import alpaca.core.ServerModelLocator;

public class GUIBuilder {
	private static final String PROGRAM_TITLE = "Alpaca Chat Server";
	
	private IServerModel model;
	
	public GUIBuilder() {
		this.model = ServerModelLocator.getServerModel();
	}

	public void create() {
		ServerView serverView = new ServerView();
		
		serverView.setTitle(PROGRAM_TITLE);
		serverView.setIconImage(new ImageIcon("img//alpaca.png").getImage()); //TODO resource mapping
		model.addPropertyChangeListener(serverView);
		model.init();
	}
}
